﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;

namespace Arbetsfornedringen.Pages
{
    public partial class HeadHunter : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void ButtonSearch_Click(object sender, EventArgs e)
        {
            var indexes = MeritsListBox.GetSelectedIndices();
            var titles = MeritsDB.GetDistinctMeritTitles();
            var lst = new List<Merit>();
            foreach (var item in indexes)
            {
                
                //lst.Add();
            }
            GridView1_LoadHits(null);
        }

        protected void MeritsListBox_Load(object sender, EventArgs e)
        {
            MeritsListBox.DataSource = MeritsDB.GetDistinctMeritTitles();
            MeritsListBox.DataBind();
        }

        protected void ClearBtn_OnClick(object sender, EventArgs e)
        {
            MeritsListBox.ClearSelection();
        }

        protected void GridView1_LoadHits(List<Merit> searches)
        {
            GridView1.DataSource = MeritsSearch.Search(searches);
            GridView1.DataBind();
        }
        
    }
}